package com.yonyou.crm.sys.modules.rmimpl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yonyou.crm.bpub.list.entity.AppListVO;
import com.yonyou.crm.sys.modules.entity.LayoutCatalogVO;
import com.yonyou.crm.sys.modules.entity.ListLayoutAssignmentVO;
import com.yonyou.crm.sys.modules.entity.ListLayoutVO;
import com.yonyou.crm.sys.modules.rmitf.IListLayoutRmService;
import com.yonyou.crm.sys.modules.service.LayoutCatalogBizServiceImpl;
import com.yonyou.crm.sys.modules.service.ListLayoutBizServiceImpl;

	
@Service
public class ListLayoutRmServiceImpl implements IListLayoutRmService {
	
	@Autowired
	private ListLayoutBizServiceImpl bizService;
	@Autowired 
	private LayoutCatalogBizServiceImpl layoutCatalogBizServiceImpl;
	
	@Override
	public List<ListLayoutVO> getListLayoutList(Long objId) {
		return bizService.getListLayoutList(objId);
	}

	@Override
	public ListLayoutVO getListLayout(Long id) {
		return bizService.getListLayout(id);
	}
	
	@Override
	public ListLayoutVO addListLayout(ListLayoutVO layoutVO) {
		return bizService.saveListLayout(layoutVO);
	}

	@Override
	public void assignListLayouts(Integer clientType,List<ListLayoutAssignmentVO> listLayoutAssignmentVOs){
		bizService.saveListLayoutAssignment(clientType,listLayoutAssignmentVOs);
	}
	
	@Override
	public ListLayoutVO updateListLayout(ListLayoutVO layoutVO) {
		return bizService.updateListLayout(layoutVO);
	}

	@Override
	public void deleteListLayout(Long id) {
		bizService.deleteListLayout(id);
	} 
	
	@Override
	public List<LayoutCatalogVO> getListLayoutCatalogList(Long objId) {
		return layoutCatalogBizServiceImpl.getListLayoutCatalogList(objId);
	}
	
	@Override
	public Map<String, Object> getAssignmentTemplate(Long objId, Integer clientType ) {
		return bizService.getAssignmentTemplate(objId, clientType);
	}
	@Override
	public AppListVO getAppListVOForCurrentUser(Long objId ){
		return bizService.getAppListVOForCurrentUser(objId);
	}

	@Override
	public void disableListLayout(Long listLayoutId) {
		bizService.saveListLayoutDisableStatus(listLayoutId);
	}

	@Override
	public void enableListLayout(Long listLayoutId) {
		bizService.saveListLayoutEnableStatus(listLayoutId);
	}
}
